package com.gxa.www.cl.service.impl;

import com.gxa.www.cl.common.util.DCMd5Util;
import com.gxa.www.cl.mapper.AdminMapper;
import com.gxa.www.cl.service.UpdateUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UpdateUpdateUserServiceImpl implements UpdateUserService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public boolean updatePassword(String username, String newPassword) {
        String encodedPassword = DCMd5Util.getMd5(newPassword);
        int rowsAffected = adminMapper.updatePassword(username, encodedPassword);
        return rowsAffected > 0;
    }
}
